package com.norman.sorry.core.tiles;

import java.awt.Color;

/**
 * Extends the functionality of a tile by allowing them to be linked together in
 * a specific order. Linked tiles are allowed to have multiple next tiles, the
 * path specified by a color, but only one previous tile.
 * 
 * @author Brian Norman
 * @version 0.0.1 beta
 * @since 0.0.1 beta
 */
public interface ILinkedTile extends ITile {

   /**
    * Returns the tile that comes before this tile. This is the tile a game
    * piece would be at if it moved backwards one tile.
    * 
    * @return the tile that comes before this tile.
    */
   public ILinkedTile getPrevious();

   /**
    * Returns the tile that comes after this tile for the given color. This is
    * the tile a game piece would be at if it moved forwards one tile and the
    * color of the game piece is the same as the given color.
    * 
    * @param color
    *           the switch color.
    * @return the tile that comes after this tile for the given color.
    */
   public ILinkedTile getNext(Color color);

}
